// Title: Tigra Calendar PRO
// Description: Tigra Calendar PRO is flexible JavaScript Calendar offering
//	 high reliability and wide browsers support.
// URL: http://www.softcomplex.com/products/tigra_calendar_pro/
// Version: 5.1b
// Date: 05-24-2002 (mm-dd-yyyy)
// Technical Support: support@softcomplex.com (specify product title and order ID)

// MODIFICATIONS
// Date modified: 06-13-2002
// Author: Tai Nguyen, tnguyen@edocs.com
// Notes: Moved some object references into a separate calendar method "cal_finish".
//   Form field can now be placed after the constructor method but before the
//   cal_finish() method.  Removed input field generation from cal_get_html(). 
//   Field must now be manually created in the HTML.
//
//   Added routine to cal_validate() to disable dates on the 29, 30, and 31st if
//   bool_reoccur_payment flag is set to true in the HTML file.
//
// Date modified: 06-25-2002
// Author: Tai Nguyen, tnguyen@edocs.com
// Notes: Changed cal_get_html() to not show past years in drop-down.
//   Changed cal_get_body() to set today's date to class="calDayToday".
//   Changed cal_finish() to update the current date to be within the
//   date range if minimum or maximum date is specified.
//
// Date modified: 06-28-2002
// Author: Tai Nguyen, tnguyen@edocs.com
// Notes: Changed calendar() to create a this.min_valid_date property which
//   is used to update the date when date is not valid.
//
// Date modified: 07-05-2002
// Author: Tai Nguyen, tnguyen@edocs.com
// Notes: Added a payment date parameter to constructor - sets selected date to 
//   payment date if specified.  Also updated cal_finish() to set date form field  
//   to current date on initialization.
//
// Date modified: 07-18-2002
// Author: Tai Nguyen
// Notes: Moved date validation code to calendar() and changed them so they would
//   only set this.dt_current, not call this.update().
//
// Date modified: 07-18-2002
// Author: Tai Nguyen
// Notes: Added a use_dt_original parameter to cal_get_body().  When set to true,
//   the calendar is rendered based on the original date, not the current date.
//   The constructor function now calls cal_get_html() with this set to true.
//
// Date modified: 07-24-2002
// Author: Tai Nguyen
// Notes: Fixed cal_get_body() logic for determining which months to show.
//
// Date modified: 07-24-2002
// Author: Tai Nguyen
// Notes: Fixed cal_rel_update() logic so that use_dt_original is only true
//    on first load.
//
// Date modified: 11-21-2002
// Author: Tai Nguyen
// Notes: Changed date field to accept object reference - allows user to set object
//    reference in the opening window.  Added parameter bool_closewin, which will close
//    the calendar window when user clicks on a date.
//
// Date modified: 04-04-2003
// Author: Tai Nguyen
// Notes: Fixed min_valid_date validation logic.
//
// Date modified: 05-27-2003
// Author: Tai Nguyen
// Notes: Removed logic to not show past years indrop-down.
//
// Date modified: 03-18-2004
// Author: Tai Nguyen
// Notes: Enhanced bind_to_date function to take value from opener's date field.  Added
//    function openCal() for opening page to create pop-up and bind to date field.
// 
// --------------------------------------------------------------------------------
// --- user configuration block ---

// months as they appear in the selection list
var ARR_MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
		"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
// week day titles as they appear on the calendar
var ARR_WEEKDAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
// day week starts from (normally 0-Su or 1-Mo)
var NUM_WEEKSTART = 0;
// range of years to show in drop-down.  if 4, will show current +/- 4 years.
var NUM_RANGEYEARS = 4;

// --------------------------------------------------------------------------------
var calendars = [];

// To be used by opening page to create calendar pop-up
var loopLimit = 0;
var timer;
var obj_datefield;
var calWin;
function openCal(dateField,calFile) {
	obj_datefield = dateField;
	calWin = window.open(calFile,'calendar','width=180,height=180,status=yes');
	timer = setInterval("bindCal(timer)",100);
}

// Look for the calendar for up to 10 seconds, then bind the date field.
function bindCal(timer) {
	if (calWin && calWin.cal) {
		calWin.cal.bindToDate(obj_datefield);
		calWin.focus();
		clearInterval(timer);
	}
	if (loopLimit==600) {
		clearInterval(timer);
		alert('Error: Unable to find calendar pop-up.\nPlease open calendar again. ' + loopLimit);
	}
	loopLimit++;
}

// Constructor
function calendar (str_date, str_form_name, str_min_date, str_max_date, str_pay_date, bool_reoccur_pay, bool_closewin) {

	// assign methods
	this.get_html  = cal_get_html;
	this.get_body  = cal_get_body;
	this.set_year  = cal_set_year;
	this.set_month = cal_set_month;
	this.set_day   = cal_set_day;
	this.validate  = cal_validate;
	this.bindToDate    = cal_bind_to_date;

	this.update = (document.body && document.body.innerHTML ? cal_css_update : cal_rel_update);

	// register in global collections
	this.id = calendars.length;
	calendars[this.id] = this;

	// process input parameters
	var re_url = new RegExp('cal' + this.id + '_val=(\\d+)');
	var dt_params = (str_date ? cal_parse_date(str_date) : cal_date_only());
	
	var has_url = re_url.exec(String(window.location))
	this.dt_current = ( has_url ? new Date(new Number(RegExp.$1)) : dt_params);
	this.dt_original = dt_params; 
	this.dt_pay = (str_pay_date ? cal_parse_date(str_pay_date) : null);
	this.bool_showpast = (str_min_date != 0) ? true : false;
	this.bool_showfuture = (str_max_date != 0) ? true : false;
	this.reoccur_pay = bool_reoccur_pay ? bool_reoccur_pay : false;
	this.closewin = bool_closewin ? bool_closewin : false;
	
	if (!str_form_name)
		return alert('Form name is required parameter of draw method.');
	if (!document.forms[str_form_name])
		return alert ("Form with name '" + this.form_name + "' can't be found in the document.");
	this.form_name = str_form_name;
	
	// set date limits
	var re_num = /^-?\d+$/;
	if (str_min_date != null)
		this.min_date = (re_num.exec(str_min_date)
			? new Date (dt_params.valueOf() - new Number(str_min_date * 864e5))
			: cal_parse_date(str_min_date)
		);
	if (str_max_date != null)
		this.max_date = (re_num.exec(str_max_date)
			? new Date (dt_params.valueOf() + new Number(str_max_date * 864e5))
			: cal_parse_date(str_max_date)
		);
	
	if (this.reoccur_pay) {
		this.min_valid_date = this.min_date ? this.min_date : this.dt_original;
		if (this.min_valid_date.getDate() >= 29 && this.min_valid_date.getDate() <= 31) {
			this.min_valid_date = new Date(this.min_valid_date.valueOf() + new Number(3 * 864e5));
			this.min_valid_date.setDate(1);
		}
	}

	
	// if a payment date was specified, set selected date to payment date
	if (this.dt_pay) this.dt_current = this.dt_pay;

	// set current date to within date limits
	if (this.max_date && this.dt_current > this.max_date) this.dt_current = this.max_date;
	if (this.min_date && this.dt_current < this.min_date) this.dt_current = this.min_date;

	var curr_date = this.dt_current.getDate();
	if (this.reoccur_pay && curr_date >= 29 && curr_date <= 31) this.dt_current = this.min_valid_date;
	
	// write input control
	var use_dt_original = !has_url;
	document.write (this.get_html(this.dt_current, use_dt_original));
}
// --------------------------------------------------------------------------------
function cal_bind_to_date(obj_datefield) {
	this.control_obj = obj_datefield;
	this.mon_ctrl    = document.forms[this.form_name].elements['dt_mon_'  + this.id];
	this.year_ctrl   = document.forms[this.form_name].elements['dt_year_' + this.id];
	
	var dt_opener = null;
	if (obj_datefield.value!="")
		dt_opener = cal_parse_date(obj_datefield.value);
	
	if (this.dt_params==null && this.dt_pay==null && dt_opener!=null)
		this.dt_current = dt_opener;
	
	// write current date to date form
	this.control_obj.value = cal_generate_date(this.dt_current);
	this.update(this.dt_current, false);
}
// --------------------------------------------------------------------------------
function cal_css_update (dt_datetime, use_dt_original) {
	use_dt_original = use_dt_original ? true : false;
	this.dt_current = dt_datetime;
	this.control_obj.value = cal_generate_date(dt_datetime);
	
	var obj_container = (document.all ?
		document.all['cal_body_' + this.id] :
		document.getElementById('cal_body_' + this.id)
	);
	obj_container.innerHTML = this.get_body(dt_datetime, use_dt_original);
	this.mon_ctrl.selectedIndex = dt_datetime.getMonth(); 
	this.year_ctrl.selectedIndex =
		dt_datetime.getFullYear() - Number(this.year_ctrl.options[1].text) + 1;
	this.control_obj.value = cal_generate_date(dt_datetime);
}
// --------------------------------------------------------------------------------
function cal_rel_update (dt_datetime, use_dt_original) {
	use_dt_original = use_dt_original ? true : false;
	var arr_location = String(window.location).split('?');
	var arr_params = String(arr_location[1]).split('&');
	var num_found = -1;
	for (var i = 0; i < arr_params.length; i++)
		if((arr_params[i].split('='))[0] == 'cal' + this.id + '_val') {
			num_found = i;
			break;
		}
	arr_params[(num_found == -1 ? (arr_location[1] ? arr_params.length : 0) : num_found)]
		= 'cal' + this.id + '_val=' + dt_datetime.valueOf();
	
	this.control_obj.value = cal_generate_date(dt_datetime);
	window.location = arr_location[0] + '?' + arr_params.join('&');
}
// --------------------------------------------------------------------------------
function cal_set_day (num_datetime) {
	var dt_newdate = new Date(num_datetime);
	this.update(this.validate(dt_newdate) ? dt_newdate : this.dt_current, false);
}
// --------------------------------------------------------------------------------
function cal_set_month () {
	var dt_newdate = new Date(this.dt_current);
	var num_month = this.mon_ctrl.options[this.mon_ctrl.selectedIndex].value;
	
	dt_newdate.setMonth(num_month);
	if (num_month != dt_newdate.getMonth())
		dt_newdate.setDate(0);
	
	if (this.validate(dt_newdate))
		this.update(dt_newdate, false);
	else
		this.mon_ctrl.selectedIndex = this.dt_current.getMonth();
}
// --------------------------------------------------------------------------------
function cal_set_year () {
	var past_yrs, future_yrs, num_range
	var dt_newdate = new Date(this.dt_current);
	var str_year = this.year_ctrl.options[this.year_ctrl.selectedIndex].text;
	var str_scroll = this.year_ctrl.options[this.year_ctrl.selectedIndex].value;
	//alert('str_scroll: ' + str_scroll);

	var num_year;
	if (str_scroll) {
		num_year = (str_scroll == '+'
			? this.dt_current.getFullYear() + NUM_RANGEYEARS
			: this.dt_current.getFullYear() - NUM_RANGEYEARS
		);
	}
	else 
		num_year = new Number(str_year);
	dt_newdate.setFullYear(num_year);
	var num_month = this.mon_ctrl.options[this.mon_ctrl.selectedIndex].value;
	if (num_month != dt_newdate.getMonth())
		dt_newdate.setDate(0);

	if (!this.validate(dt_newdate)) {
		this.year_ctrl.selectedIndex = this.dt_current.getFullYear() - Number(this.year_ctrl.options[1].text) + 1;
		return;
	}
	
	if (this.bool_showpast || (num_year - this.dt_original.getFullYear() >= NUM_RANGEYEARS)) {
		past_yrs = NUM_RANGEYEARS;
	} else {
		past_yrs = num_year - this.dt_original.getFullYear();
	}
	
	if (this.bool_showfuture || (this.dt_original.getFullYear() - num_year >= NUM_RANGEYEARS) ) {
		future_yrs = NUM_RANGEYEARS;
	} else {
		future_yrs = this.dt_original.getFullYear() - num_year;
	}

	if (str_scroll) {
		//alert('inside str_scroll');
		num_range = past_yrs + future_yrs;
		this.year_ctrl.length = 0;
		
		if (this.bool_showpast || (num_year - this.dt_original.getFullYear() > NUM_RANGEYEARS)) {
			this.year_ctrl.options[0] = new Option('<< ' + (num_year - past_yrs), '-');
		} else {
			this.year_ctrl.options[0] = new Option(num_year - past_yrs);
		}

		for (var i = 1; i < num_range; i++) {
			this.year_ctrl.options[i] = new Option(num_year - past_yrs + i);
			this.year_ctrl.options[i].selected = !(i-past_yrs);
		}

		if (this.bool_showfuture || (this.dt_original.getFullYear() - num_year > NUM_RANGEYEARS) ) {
			this.year_ctrl.options[num_range] = new Option((num_year + future_yrs) + ' >>', '+');
		} else {
			this.year_ctrl.options[num_range] = new Option(num_year + future_yrs);
		}
	}
	
	this.update(dt_newdate, false);
}

// --------------------------------------------------------------------------------
function cal_get_html (dt_datetime, use_dt_original) {
	var past_yrs, future_yrs
	
	if (this.bool_showpast || (this.dt_current.getFullYear() - this.dt_original.getFullYear() >= NUM_RANGEYEARS) ) {
		past_yrs = NUM_RANGEYEARS;
	} else {
		past_yrs = 0;
	}
	
	if (this.bool_showfuture || (this.dt_original.getFullYear() - this.dt_current.getFullYear() >= NUM_RANGEYEARS) ) {
		future_yrs = NUM_RANGEYEARS;
	} else {
		future_yrs = 0;
	}

	use_dt_original = use_dt_original ? true : false;
	
	// print calendar header
	var i, str_buffer = new String (
		'<table cellspacing="0" class="calOuterTable" border="0"><tr>' +
		'<td><input type="Hidden" name="' + this.control_name + '" value="' + cal_generate_date(this.dt_current) + '">' + 
		'<table cellspacing="0" class="calSelectTable"><tr><td>' +
		'<select name="dt_mon_' + this.id + '" class="calMonCtrl" onchange="return calendars[' + this.id + '].set_month();">');
	for (i = 0; i < 12; i++)
			str_buffer += '<option value="' + i + '"' + (i == dt_datetime.getMonth() ? ' selected' : '') + '>' + ARR_MONTHS[i] + "</option>\n";
	str_buffer += '</select></td>' +
		'<td align="right"><select name="dt_year_' + this.id + '" class="calYearCtrl" onchange="return calendars[' + this.id + '].set_year();">'

	if (past_yrs) {
		str_buffer += '<option value="-">&lt;&lt; ' + (dt_datetime.getFullYear() - past_yrs) + "</option>\n";
	} else {
		str_buffer += '<option>' + (dt_datetime.getFullYear() -past_yrs) +  "</option>\n"
	}

	for (i = past_yrs ? -(past_yrs-1) : 1; i < future_yrs; i++)
			str_buffer += '<option' + (i == 0 ? ' selected="selected"' : '') + '>' + (dt_datetime.getFullYear() + i) + "</option>\n";
	
	if (future_yrs) {
		str_buffer += '<option value="+">' + (dt_datetime.getFullYear() + future_yrs) +  " &gt;&gt;</option>\n"
	} else {
		str_buffer += '<option>' + (dt_datetime.getFullYear() + future_yrs) +  "</option>\n"
	}
	
	str_buffer += '</select></td></tr></table></td></tr>' +
		'<tr><td><div id="cal_body_' + this.id + '">' + this.get_body(dt_datetime, use_dt_original) +'</div>'
		+ '</td>'
		+ '</tr></table>';

	return (str_buffer);
}
// --------------------------------------------------------------------------------
function cal_get_body (dt_datetime, use_dt_original) {
	var str_closewindow = this.closewin ? "self.close();" : ""
	
	use_dt_original = use_dt_original ? true : false;
	
	// get same date in the previous year
	var dt_prev_year = new Date(dt_datetime);
	dt_prev_year.setFullYear(dt_prev_year.getFullYear() - 1);
	if (dt_prev_year.getDate() != dt_datetime.getDate())
		dt_prev_year.setDate(0);
	
	// get same date in the next year
	var dt_next_year = new Date(dt_datetime);
	dt_next_year.setFullYear(dt_next_year.getFullYear() + 1);
	if (dt_next_year.getDate() != dt_datetime.getDate())
		dt_next_year.setDate(0);
	
	var dt_firstday = new Date(use_dt_original ? this.dt_original : dt_datetime);
	
	// set the month the date is in
	var cal_main_month = dt_firstday.getMonth();
	
	// get first day to display in the grid for current month
	dt_firstday.setDate(1);
	dt_firstday.setDate(1 - (7 + dt_firstday.getDay() - NUM_WEEKSTART) % 7);
	
	// set the month the first day to display is in
	var cal_prev_month = dt_firstday.getMonth();
	
	var dt_current_day = new Date(dt_firstday);
	
	// print calendar body
	var str_buffer = new String (
	'<table cellspacing="1" cellpadding="2" class="calDaysTable" width="100%">');
	
	// print weekdays titles
	str_buffer += '<tr>';
	for (var n = 0; n < 7; n++)
		str_buffer += '<td class="calWTitle">' + ARR_WEEKDAYS[(NUM_WEEKSTART + n) % 7] + '</td>';
	// print calendar table
	str_buffer += "</tr>\n";
	
	while (	dt_current_day.getMonth() == cal_prev_month || dt_current_day.getMonth() == cal_main_month ) {	
		// print row header
		str_buffer += '<tr>';
		for (var n_current_wday = 0; n_current_wday < 7; n_current_wday++) {
			// is the current day today's date
			var bool_istoday = (this.dt_original.getDate() == dt_current_day.getDate() &&
								this.dt_original.getMonth() == dt_current_day.getMonth() &&
								this.dt_original.getFullYear() == dt_current_day.getFullYear());
			
			// --- set background style ---
			if (dt_current_day.getDate() == dt_datetime.getDate() &&
				dt_current_day.getMonth() == dt_datetime.getMonth())
				// print current date
				str_buffer += '<td class="calDayCurrent" align="center" valign="middle">';
			else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
				// weekend days
				str_buffer += '<td class="calDayWeekend" align="center" valign="middle">';
			else
				// print working days of current month
				str_buffer += '<td class="calDayWorking" align="center" valign="middle">';

			// --- set foreground style ---
			// forbidden dates
			if (!this.validate(dt_current_day, true))
				str_buffer += '<span class="calForbDate">'
					+ (bool_istoday ? '<SPAN CLASS="calDayToday">' : '')
					+ dt_current_day.getDate()
					+ (bool_istoday ? '</SPAN>' : '')
					+ '</span></td>';
			// dates of current month
			else if (dt_current_day.getMonth() == dt_datetime.getMonth())
				str_buffer += '<a href="javascript:calendars[' + this.id +
					'].set_day(' + dt_current_day.valueOf() + ');' + str_closewindow + '" class="calThisMonth">'
					+ (bool_istoday ? '<SPAN CLASS="calDayToday">' : '')
					+ dt_current_day.getDate()
					+ (bool_istoday ? '</SPAN>' : '')
					+ '</a></td>';
			// dates of other months
			else 
				str_buffer += '<a href="javascript:calendars[' + this.id +
					'].set_day(' + dt_current_day.valueOf() + ');' + str_closewindow + '" class="calOtherMonth">'
					+ (bool_istoday ? '<SPAN CLASS="calDayToday">' : '')
					+ dt_current_day.getDate()
					+ (bool_istoday ? '</SPAN>' : '')
					+ '</a></td>';

			dt_current_day.setDate(dt_current_day.getDate() + 1);
		}
		// print row footer
		str_buffer += "</tr>\n";
	}
	// print calendar footer

	str_buffer +=
		'</table>';

	return (str_buffer);
}

// --------------------------------------------------------------------------------
// Discard time fields of date object
function cal_date_only (dt_datetime) {
	if (!dt_datetime)
		dt_datetime = new Date();
	dt_datetime.setHours(0);
	dt_datetime.setMinutes(0);
	dt_datetime.setSeconds(0);
	dt_datetime.setMilliseconds(0);
	return dt_datetime;
}

function cal_validate (dt_datetime, b_silent) {
	if (this.max_date && dt_datetime > this.max_date) {
		if (!b_silent)
			this.update(this.max_date, false);
			// alert ('Sorry, dates after ' + cal_generate_date(this.max_date) + ' are not allowed.');
		return false;
	}
	if (this.min_date && dt_datetime < this.min_date) {
		if (!b_silent)
			this.update(this.min_date, false);
			// alert ('Sorry, dates before ' + cal_generate_date() + ' are not allowed.');
		return false;
	}
	// more validation can be added here
	var curr_date = dt_datetime.getDate();
	if ( this.reoccur_pay && curr_date >= 29 && curr_date <= 31 ) {
		if (!b_silent)
			this.update(this.min_valid_date, false);
			// alert ('Sorry, reoccurring payments are not allowed on the 29th, 30th, or 31st.');
		return false;
	}
	return true;
}
// --------------------------------------------------------------------------------
// string to date object converter. input format is mm-dd-yyyy hh:mm:ss
// this method may be customized - string date format
function cal_parse_date (str_date) {
	var re_date = /^(\d+)\/(\d+)\/(\d+)$/;
	//alert('date: ' + RegExp.$3)
	if (!re_date.exec(str_date))
		return alert("Parsing error: unsupported date format '" + str_date + "'");
	return (new Date (RegExp.$3, RegExp.$1-1, RegExp.$2));
}

// date object to string converter, output format is mm/dd/yyyy
// this method may be customized - string date format
function cal_generate_date (dt_date) {
	return (
		new String (
			(dt_date.getMonth() < 9 ? '0' : '') + (dt_date.getMonth() + 1) + '/'
			+ (dt_date.getDate() < 10 ? '0' : '') + dt_date.getDate() + '/'
			+ dt_date.getFullYear()
		)
	);
}


// --------------------------------------------------------------------------------
// USE THE FOLLOWING DATE PARSERS IF DIFFERENT DATE FORMATS ARE NEEDED - 
// RENAME FUNCTIONS TO CAL_PARSE_DATE AND CAL_GENERATE_DATE

// string to date object converter. input format is mm-dd-yyyy hh:mm:ss
// this method may be customized - string date format
function cal_parse_date_1 (str_date) {
	var re_date = /^(\d+)\/(\d+)\/(\d+)$/;
	//alert('date: ' + RegExp.$3)
	if (!re_date.exec(str_date))
		return alert("Parsing error: unsupported date format '" + str_date + "'");
	return (new Date (RegExp.$3, RegExp.$1-1, RegExp.$2));
}

// date object to string converter, output format is mm/dd/yyyy
// this method may be customized - string date format
function cal_generate_date_1 (dt_date) {
	return (
		new String (
			(dt_date.getMonth() < 9 ? '0' : '') + (dt_date.getMonth() + 1) + '/'
			+ (dt_date.getDate() < 10 ? '0' : '') + dt_date.getDate() + '/'
			+ dt_date.getFullYear()
		)
	);
}

// string to date object converter. input format is dd-mm-yyyy hh:mm:ss
// this method may be customized - string date format
function cal_parse_date_2 (str_date) {
	var re_date = /^(\d+)\-(\d+)\-(\d+)$/;
	if (!re_date.exec(str_date))
		return alert("Parsing error: unsupported date format '" + str_date + "'");
	return (new Date (RegExp.$1, RegExp.$2-1, RegExp.$3));
}

// date object to string converter, output format is dd-mm-yyyy hh:mm:ss
// this method may be customized - string date format
function cal_generate_date_2 (dt_date) {
	return (
		new String (
			dt_date.getFullYear() + "-"
			+ (dt_date.getMonth() < 9 ? '0' : '') + (dt_date.getMonth() + 1) + "-"
			+ (dt_date.getDate() < 10 ? '0' : '') + dt_date.getDate()
		)
	);
}

// string to date object converter. input format is dd-mm-yyyy hh:mm:ss
// this method may be customized - string date format
function cal_parse_date_3 (str_date) {
	var re_date = /^(\d+)\-(\d+)\-(\d+)$/;
	if (!re_date.exec(str_date))
		return alert("Parsing error: unsupported date format '" + str_date + "'");
	return (new Date (RegExp.$3, RegExp.$2-1, RegExp.$1));
}

// date object to string converter, output format is dd-mm-yyyy hh:mm:ss
// this method may be customized - string date format
function cal_generate_date_3 (dt_date) {
	return (
		new String (
			(dt_date.getDate() < 10 ? '0' : '') + dt_date.getDate() + "-"
			+ (dt_date.getMonth() < 9 ? '0' : '') + (dt_date.getMonth() + 1) + "-"
			+ dt_date.getFullYear()
		)
	);
}

// --------------------------------------------------------------------------------
